using System;
using Jink.Core.Json.Values;
using Jink.Core.Converters;

namespace Jink.Core.Json
{
    // todo. also support circular references

    public static class JsonDeserializer
    {
        public static T FromJson<T>(this JsonValue json, params Object[] ctx)
        {
            return (T)json.FromJson(typeof(T), ctx);
        }

        public static Object FromJson(this JsonValue json, Type t, params Object[] ctx)
        {
            return json.Convert(t, ctx);
        }
    }
}